#define _CRT_SECURE_NO_WARNINGS 1

#include <iostream>
#include <string>
#include <vector>
using namespace std;

int main() {
    int n = 0, ans = 0, a = 0, b = 0;
    cin >> n >> ans >> a >> b;

    vector<vector<string>> v(n, vector<string>(2));
    int k = 0, l = 0;
    for (int i = 0; i < n; i++)
    {
        cin >> v[i][0] >> v[i][1];
        if (v[i][0] == "?")
        {
            k++;
        }
        else
        {
            l++;
        }
    }
    if (k > a || l > b)
    {
        cout << "no" << endl;
        return 0;
    }

    int temp = stoi(v.back()[1]);
    if (temp == ans)
    {
        cout << "yes" << endl;
    }
    else
    {
        cout << "no" << endl;
    }

    return 0;
}